Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile #3

Merged
merged 4 commits into from
Jul 8, 2024
Merged

Add Dockerfile #3

merged 4 commits into from
Jul 8, 2024

Conversation

bufo24
Copy link
Contributor

@bufo24 bufo24 commented Jul 4, 2024

Added a simple Dockerfile for docker deployments.
Feel free to give suggestions to make it the build quicker or the image smaller

Copy link
Member

@michael1011 michael1011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your image has a size of 4.97GB. Mostly because of compiler artifacts and the Rust compiler toolchain, neither of which are needed in the image.

Something like this:

FROM rust:1.79 AS builder

WORKDIR /app

COPY ./ ./

RUN cargo build --release

FROM debian:bookworm-slim

RUN apt-get update && \
  apt-get upgrade && \
  apt-get install -y libsqlite3-0 libpq5 && \
  apt-get clean all && \
  rm -rf /var/lib/apt/lists/*

COPY --from=builder /app/target/release/covclaim /usr/local/bin/covclaim

EXPOSE 1234

CMD ["/usr/local/bin/covclaim"]

Has only 93MB. The most important thing is separating the build into two stages, one to compile and one that will become the actual image.

@michael1011
Copy link
Member

And rebase this branch. I just pushed a fix that allows covclaim to start without an .env file

Copy link
Member

@michael1011 michael1011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good after couple more minor changes

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@bufo24 bufo24 requested a review from michael1011 July 8, 2024 13:12
@michael1011 michael1011 merged commit 6efe35b into BoltzExchange:main Jul 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants